import request from '@/utils/request'

// 查询陈列V5算法SKU列表
export function listDisplayAlgoV5(query) {
  return request({
    url: '/genius/platform-display-algo-v5/list',
    method: 'get',
    params: query
  })
}

// 获取陈列V5算法SKU详细信息
export function getDisplayAlgoV5(id) {
  return request({
    url: '/genius/platform-display-algo-v5/' + id,
    method: 'get'
  })
}

// 新增陈列V5算法SKU
export function addDisplayAlgoV5(data) {
  return request({
    url: '/genius/platform-display-algo-v5',
    method: 'post',
    data: data
  })
}

// 识别陈列V5算法
export function v5Recognize(params) {
  const { file } = params
  return request({
    url: '/genius/platform-display-algo-v5/detect',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'POST',
    data: file,
    timeout: 60 * 3 * 1000
  })
}

// 修改陈列V5算法SKU
export function updateDisplayAlgoV5(data) {
  return request({
    url: '/genius/platform-display-algo-v5',
    method: 'put',
    data: data
  })
}

// 删除平台风幕柜商品
export function delDisplayAlgoV5(id) {
  return request({
    url: '/genius/platform-display-algo-v5/' + id,
    method: 'delete'
  })
}

